package com.spring.demo12.eg3;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author vhans
 */
@Component
public class SendEmailOnOrderCreateListener implements ApplicationListener<OrderCreateEvent> {
    @Override
    public void onApplicationEvent(OrderCreateEvent orderCreateEvent) {
        System.out.printf("订单「%d」创建成功，给下单人发送邮箱通知！", orderCreateEvent.getOrderId());
    }
}
